# slice(a, b)：也是一个变量，保存a[a:b]的a:b
slice_first_three = slice(0, 3)
print(list(range(10))[slice_first_three])

l = list(range(10))
# l[2::3] = [100] # 不连续的必须元素数相同
l[2::3] = [100, 10, 1] # 不连续的必须元素数相同
l[2:5] = [100]  # 连续的可以改变元素数
print(l)

weird_board = [['_'] * 3] * 3
# row = ['_'] * 3
# weird_board = []
# for i in range(3):
#     weird_board.append(row)
board = [['_'] * 3 for _ in range(3)]  # 确实得用这种写法！
# board = []
# for i in range(3):
#     row = ['_'] * 3
#     board.append(row)
